package ytmc.setup;

import ytmc.Controller;
import ytmc.View;


/**
 *
 * @author Kicok
 */
public class SetupController implements Controller
{
    private SetupModel model;
    private SetupView view;

    public SetupController()
    {
        model = new SetupModel();
        view = new SetupView( this, model );
        view.setFormChanged( false );
    }


    public void formCanceled()
    {
        Config.reload();
        model.loadSetup();
        view.setFormChanged( false );
    }

    public void formAccepted()
    {
        view.sendForm();
        model.saveSetup();
        view.setFormChanged( false );
    }


    @Override
    public View getView()
    {
        return view;
    }
}
